ManfroC (Ex-Member)
Rookie
Messaggi: 26
Iscritto: 15/05/2011
|
Ciao ragazzi volevo chiedervi come mai quando avvio la webcam il programma mi crassha???
Codice sorgente - presumibilmente C++ |
private void WebCam() { int Hwnd; short iDevice; Manfro_Photo_Tools.CaptureWebCam.capGetDriverDescriptionA( 0, "" , 100, "", 100); Hwnd = Manfro_Photo_Tools.CaptureWebCam.capCreateCaptureWindowA(0 CaptureWebCam.WS_CHILD | CaptureWebCam.WS_VISIBLE, 0, 0, 640, 480 , 0, 0); if (Convert.ToBoolean(Manfro_Photo_Tools.CaptureWebCam.SendMessageA(Hwnd, Manfro_Photo_Tools.CaptureWebCam.WM_CAP_DRIVER_CONNECT,0 , 0))) { //Imposto la preview Manfro_Photo_Tools.CaptureWebCam.SendMessageA(Hwnd,Manfro_Photo_Tools.CaptureWebCam.WM_CAP_SET_SCALE, 1, 0); //imposto il rate in millisecondi Manfro_Photo_Tools.CaptureWebCam.SendMessageA(Hwnd,Manfro_Photo_Tools.CaptureWebCam.WM_CAP_SET_PREVIEWRATE, 66, 0); //Faccio partire la preview Manfro_Photo_Tools.CaptureWebCam.SendMessageA(Hwnd,Manfro_Photo_Tools.CaptureWebCam.WM_CAP_SET_PREVIEW, 1, 0); //Scalo la preview all'interno della dimensione del mio box immagine Manfro_Photo_Tools.CaptureWebCam.SetWindowPos(Hwnd,Manfro_Photo_Tools.CaptureWebCam.HWND_BOTTOM, 6, 5, 4, 3,Manfro_Photo_Tools.CaptureWebCam.SWP_NOMOVE | Manfro_Photo_Tools.CaptureWebCam.SWP_NOZORDER); } else { // .Capture.DestroyWindow(Hwnd); System.Windows.Forms.MessageBox.Show(this, "WebCam non ATTIVA", "PhotoWebcam"); } return; }
|
e poi un altra cosa? in visual basic sapevo che si usava il device Microsoft WMD capture win32 e in C#?Come faccio ad aggiungerlo??
|